PROJECT(TCPSERVER)

# version
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

# 使用C++11编译
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")

# build
SET(MAKE_SYSTEM "\\\"${CMAKE_SYSTEM}\\\"")
ADD_DEFINITIONS(-D MAKE_SYSTEM=${MAKE_SYSTEM})

# TCPSERVER SRC
AUX_SOURCE_DIRECTORY(${TCPSERVER_SOURCE_DIR}/talks TCPSERVER_SRC_LIST)

IF(CMAKE_BUILD_TYPE STREQUAL Release)
	# target
    SET(TCPSERVER_TARGET    tcpServer)
ELSE()
	# target
    SET(TCPSERVER_TARGET    tcpServer.d)
ENDIF()


# link lib
SET(TCPSERVER_LIB_LIST  pthread)

# EXECUTE
ADD_EXECUTABLE(${TCPSERVER_TARGET}   ${TCPSERVER_SRC_LIST})

# TARGET
TARGET_LINK_LIBRARIES(${TCPSERVER_TARGET}   ${TCPSERVER_LIB_LIST})